package com.ghao.douban.controller;

import org.apache.shiro.authz.AuthorizationException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class ExceptionControllerAdvise {

    //如果需要返回json 可以使用@ResponseB ody
    @ExceptionHandler(AuthorizationException.class)
    public String handlerAuthorException(Exception e){
        return "noPerm";
    }
}
